package com.carkeeper.servetype.service.impl;

import com.carkeeper.billpay.feign.PayLogFeign;
import com.carkeeper.entity.Result;
import com.carkeeper.servetype.dao.LineChartMapper;
import com.carkeeper.servetype.service.LineChartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
@Service
public class LineChartServiceImpl implements LineChartService {

    @Autowired
    private LineChartMapper lineChartMapper;

    @Autowired
    private PayLogFeign payLogFeign;
    @Override
    public List<Integer> findStoreBillCountByDays(List<String> days) {
        List<Integer> list = new ArrayList<>();
        for (String day : days) {
            day = day+".31";
            //System.out.println("day = " + day);
            Integer count = payLogFeign.findTotalMoneyByDate(day);
            //Integer count = lineChartMapper.findMemberCountBeforeDate(day);
            list.add(count);
            //System.out.println("count = " + count);
        }
        return list;
    }


}
